package com.sgcc.pda.frme.protocol.ws.sendbean;

import androidx.annotation.NonNull;

import android.text.TextUtils;

import com.sgcc.pda.frme.protocol.ws.DataConvert;

/**
 * 描 述：RFID参数设定命令
 * 作 者：yangzhi  2020/7/13 16:27
 * 修改描述： XXX
 * 修 改 人： XXX  2020/7/13 16:27
 * 修改版本： XXX
 */
public class RfidSet2002 {

    /**
     * 当前发射功率
     */
    private String fsgl;

    /**
     * 频段
     */
    private String pDuan;

    /**
     * 跳频模式
     */
    private String tpms;

    /**
     * 频点
     */
    private String pDian;

    /**
     * RFID通信速率
     */
    private String txsl;
    /**
     * 防碰撞场景
     */
    private String fpz;
    /**
     * 重复标签过滤时间
     */
    private String glsj;


    @NonNull
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();

        if (TextUtils.isEmpty(fsgl)) {
            return null;
        }
        fsgl = DataConvert.toHexString(Integer.parseInt(fsgl), 1);
        sb.append(fsgl);

        if (TextUtils.isEmpty(pDuan)) {
            return null;
        }
        pDuan = DataConvert.toHexString(Integer.parseInt(pDuan), 1);
        sb.append(pDuan);
        if (TextUtils.isEmpty(tpms)) {
            return null;
        }
        tpms = DataConvert.toHexString(Integer.parseInt(tpms), 1);
        sb.append(tpms);

        if (TextUtils.isEmpty(pDian)) {
            return null;
        }
        pDian = DataConvert.toHexString(Integer.parseInt(pDian), 4);
        sb.append(DataConvert.strReverse(pDian, 0, pDian.length()));


        if (TextUtils.isEmpty(txsl)) {
            return null;
        }
        txsl = DataConvert.toHexString(Integer.parseInt(txsl), 1);
        sb.append(txsl);

        if (TextUtils.isEmpty(fpz)) {
            return null;
        }
        fpz = DataConvert.toHexString(Integer.parseInt(fpz), 1);
        sb.append(fpz);

        if (TextUtils.isEmpty(glsj)) {
            return null;
        }
        glsj = DataConvert.toHexString(Integer.parseInt(glsj), 4);
        sb.append(DataConvert.strReverse(glsj, 0, glsj.length()));
        return sb.toString();
    }

    public String getFsgl() {
        return fsgl;
    }

    public void setFsgl(String fsgl) {
        this.fsgl = fsgl;
    }

    public String getpDuan() {
        return pDuan;
    }

    public void setpDuan(String pDuan) {
        this.pDuan = pDuan;
    }

    public String getTpms() {
        return tpms;
    }

    public void setTpms(String tpms) {
        this.tpms = tpms;
    }

    public String getpDian() {
        return pDian;
    }

    public void setpDian(String pDian) {
        this.pDian = pDian;
    }

    public String getTxsl() {
        return txsl;
    }

    public void setTxsl(String txsl) {
        this.txsl = txsl;
    }

    public String getFpz() {
        return fpz;
    }

    public void setFpz(String fpz) {
        this.fpz = fpz;
    }

    public String getGlsj() {
        return glsj;
    }

    public void setGlsj(String glsj) {
        this.glsj = glsj;
    }
}
